<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>


<html>
	<head>
		<s:head theme="ajax" />

		<title>userInput.jsp</title>
		<link rel="stylesheet" type="text/css" href="../css/counter.css">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">

		<link rel="stylesheet" type="text/css" href="../css/css.css">
		<script type="text/javascript">
	function validateQxkw(){
	
	if(document.getElementById('qm_name').value==""){
    alert("推荐单位不能为空");
	return false;
	}

	
	if(document.getElementById('qm_type').value==""){
    alert("请选择推荐单位！");
	return false;
	}


	}

	</script>

	</head>

	<body>
		<br>
		<form method="post" action="modifyQxkwDo.action" name="form1" 
			onsubmit="return validateQxkw();">
		<input type="hidden"  value="${qm.typeid}" name="typeid" >
		<input type="hidden"  value="${qm.id}" name="qm.id" >
			<TABLE cellSpacing="0" cellPadding="0" width="100%" align="center"
				border="0">
				<TBODY>
					<TR>
						<TD>
							<IMG src="../images/manage/arron1.gif">
							<FONT class="font_lv">修改推荐单位</FONT>
						</TD>
					</TR>
				</TBODY>
			</TABLE>
			<table cellSpacing="1" cellPadding="1" width="100%" align="center"
				border="0">
				<tr>
					<td class=line>
						<table height="100%" cellSpacing=1 cellPadding=2 width="100%"
							bgcolor="#CCCCCC" border=0>
							<tr bgcolor="#FFFFFF">
								<td height="25" colspan="2" align="center"
									background="../images/manage/title_bg.jpg" class="font_12_B_w">
									推荐单位修改
								</td>
								<td height="25" colspan="2"
									background="../images/manage/title_bg.jpg">
									注意
									<font color="red">*</font>表示必填项；英文和数字应为半角字符
								</td>



							</tr>

							<tr bgcolor="#FFFFFF">
								<td width="294" height="25">
									推荐单位名称								</td>
								<td width="581">
								 <s:textfield name="qm.name" required="true"
										 cssClass="id_kuang" theme="simple"
										maxlength="30" size="30" ></s:textfield>
								
							  </td>
								<td width="476" height="25">
									<font color="red">*</font>								</td>
							     </tr>
							
							
							<tr bgcolor="#FFFFFF">
								<td height="30">
									所属推荐单位类型
								</td>
								<td>
									
								<s:select name="qm.typeid" list="qxkwtypeList" listKey="id"
										listValue="name" theme="simple"
										headerValue="%{getText('select.info')}" headerKey="" disabled="true"></s:select>
							
								</td>
								<td width="476" height="25">
									<font color="red">*</font>								</td>
							</tr>
							
							
							<tr bgcolor="#FFFFFF">
								<td height="33">&nbsp;
									
							  </td>
								<td>
									<input type="submit" name="Submit" class="btn1" value="提交">
									<input type="button" class="btn1" name="Submit2"
										onclick="history.go(-1);" value="取消">
								</td>
								<td width="476" height="25">&nbsp;								</td>
							</tr>
						</table>

					</td>

				</tr>
			</table>
		</form>
<s:url id="smdUrl" namespace="/admin" action="verfiyQxkw" />
	</body>

	<script type="text/javascript">
    //load dojo RPC
    function verifyQxkwmc(){
    dojo.require("dojo.rpc.*");
    
    //create service object(proxy) using SMD (generated by the json result)
    var service = new dojo.rpc.JsonService("${smdUrl}");
    var name=document.getElementById('qxkwmc').value;
       //parameter
    var bean= {name:name};
    
    //execute remote method
    var defered = service.doSameName(bean);
    
    //function called when remote method returns
   
    
    var callback = function(bean) {
        if(bean.name!=""){
        alert("推荐单位名称【  " +name + "】 已经注册了！");
        document.getElementById('qxkwmc').focus();
        document.getElementById('qxkwmc').value="";
        return false;
        }else {
        return true;
        }
       // is.innerHTML=bean.price;
        
    };
    
 

    //attach callback to defered object
    defered.addCallback(callback);
    }
</script>
</html>
